<template>
	<div>
	</div>
</template>

<script>
	import Vue from 'vue';
	import { SubmitBar } from 'vant';
	
	Vue.use(SubmitBar);
	export default{
		data(){
			return {
				num:0
			}
		},
		methods:{
			onSubmit(){
				this.$router.push('/Confirm')
			},
		},
		created() {
			this.$http.get('/goodscar/carinfo',{
				u_id:this.$store.state.u_id
			}).then(res=>{
				// 计算总价
				for(var i = 0 ; i<JSON.parse(res.data.data[0].goods_info).length;i++){
					this.num+=JSON.parse(res.data.data[0].goods_info)[i].g_price*JSON.parse(res.data.data[0].goods_info)[i].g_count
				}
			})
		},
	}
</script>

<style>
	.van-submit-bar{
		bottom: 50px;
		position: absolute;
		z-index: 1 !important;
	}
	
</style>
